#pragma once

namespace xmlredirect
{
	class IAction
	{};

	class IProcessing
	{
	public:
		virtual string	GetPath() = 0;
		virtual IAction	Add(const xml::pnode& node) = 0;
	};

	class 
	class ConfigProcessing
	{
	public:
		ConfigProcessing(boost::shared_ptr<hc::Scheduler> spScheduler, const string& xmlPath);
		void Add( boost::shared_ptr<IProcessing>& sp_processing);
		void Run();
		
		CSystemSettings 
	private:
		void Search( boost::shared_ptr<IProcessing>& proc );

		xml::pdocument m_xml;
		list< boost::shared_ptr<IProcessing> > m_processing;
		boost::shared_ptr<hc::Scheduler> m_spScheduler;
	};

	class TaskProcessing : public IProcessing 
	{
	public:  
		TaskProcessing(const string& path);
		virtual IAction Add(const xml::pnode& node);

	private:
		class Move
		{
		public:
			Move(const string& path);
			virtual IAction Add(const xml::pnode& node);

		private:
			void HandleMoveTag(const xml::pnode& node);
			void HandleWhatTag(const xml::pnode& node, MoveData& data);
			string m_path;

		};
		IAction m_action;
	};
	class MoveProcessing : public IProcessing 
	{
	public:
		IAction m_action;
	};

	class ISystemSettingResult
	{
	public:
		virtual map<string, string>	GetResult() = 0;
	};

	class SystemSettingProcessing : public IProcessing
	{
	public:
		SystemSettingProcessing(const string& path);
		virtual IAction Add(const xml::pnode& node);
		virtual map<string, string> GetResult();
		virtual string	GetPath();

	private:
		void GetTagAttributeValue( const xml::pnode& node, const string& tagName, const string& tagAttributeName );

		string m_path;
		map<string, string> m_result;
	};
}
